﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace KGE.Define
{
    [Serializable]
    public class Scene
    {
        [Serializable]
        public class Layer
        {
            [Serializable]
            public class Tile
            {
                //public ObjectIndexer KImagePackageIndexer;
                public ObjectIndexer KImageIndexer;
                public ObjectIndexer KMovieIndexer;
                public Color FilterColor;
                public Rectangle DrawRectangle;
            }

            List<Tile> items = new List<Tile>();

            public void Add(Tile tile)
            {
                items.Add(tile);
            }
            public void Del(int index)
            {
                items.RemoveAt(index);
            }
            public Tile this[int index]
            {
                get
                {
                    return items[index];
                }
            }
            public int TileCount
            {
                get
                {
                    return items.Count;
                }
            }
        }
        List<Layer> items = new List<Layer>();
        public List<Rectangle> Zones = new List<Rectangle>();

        public void Add(Rectangle rect)
        {
            Zones.Add(rect);
        }

        public void Add(Layer layer)
        {
            items.Add(layer);
        }
        public void Del(int index)
        {
            items.RemoveAt(index);
        }
        public Layer this[int index]
        {
            get
            {
                return items[index];
            }
        }
        public int LayerCount
        {
            get
            {
                return items.Count;
            }
        }

        public string Name;
        public Guid GUID;
        public string Version;
        public DateTime CreateTime;

        [NonSerialized]
        public Point Location;
        public Size Size;
        public Color FilterColor;
        public ObjectIndexer KSoundIndexer;

        public Scene()
        {
            for (int i = 0; i < 4; i++)
            {
                items.Add(new Layer());
            }
        }
    }
}
